<template>
    <div>
        <div>
            <button @click="addNum">+1</button>
            <button @click="reduceNum">-1</button>
        </div>
        <div>
            <button @click="timeAddNum">2秒后+1</button>
            <button @click="timeReduceNum">2秒后-1</button>
        </div>
    </div>
</template>

<script>
export default {
    methods: {
        addNum() {
            this.$store.commit('add');
        },
        reduceNum() {
            this.$store.commit('reduce');
        },
        timeAddNum() {
            this.$store.dispatch('timeAdd');
        },
        timeReduceNum() {
            this.$store.dispatch('timeReduce');
        }
    }
};
</script>

<style></style>
